	const totalInput = document.getElementById('total');const feetInput = document.getElementById('feet');const calculateBtn = document.getElementById('calculate');const resultP = document.getElementById('result');calculateBtn.addEventListener('click', () => {
   const total = parseInt(totalInput.value);
   const feet = parseInt(feetInput.value);
   let chicken = -1, rabbit = -1;
   for (let i = 0; i <= total; i++) {
       if (2 * i + 4 * (total - i) === feet) {
           chicken = i;
           rabbit = total - i;
           break;
       }
   }
   if (chicken >= 0 && rabbit >= 0) {
       resultP.style.color = 'blue';
       resultP.textContent = `分别有鸡${chicken}只，有兔子${rabbit}只`;
   } else {
       resultP.style.color = 'red';
       resultP.textContent = '无解';
   }});